// 响应策略类型
export const CONTROLLED_OPTIONS = [
  {
    label: "特约削峰",
    value: "0"
  },
  {
    label: "特约填谷",
    value: "1"
  },
  {
    label: "实时削峰",
    value: "2"
  },
  {
    label: "实时填谷",
    value: "3"
  }
];
// 事件类型
export const DREVENT_OPTIONS = [
  {
    label: "直控",
    value: "0"
  },
  {
    label: "自控",
    value: "1"
  }
];
// 下发状态
export const ISSUE_OPTIONS = [
  {
    label: "未下发",
    value: "0"
  },
  {
    label: "已下发",
    value: "1"
  }
];
// 检验状态
export const REVIEW_OPTIONS = [
  {
    label: "不通过",
    value: "0"
  },
  {
    label: "通过",
    value: "1"
  }
];
// 客户评估结果
export const ASSESS_RESULT_OPTIONS = [
  {
    label: "达到预期",
    value: "1"
  },
  {
    label: "未达到预期",
    value: "2"
  }
];
// 客户是否响应及时
export const CUST_RESPONSE_OPTIONS = [
  {
    label: "是",
    value: "1"
  },
  {
    label: "否",
    value: "2"
  }
];
export const TABLE_COLUNMS = [
  {
    title: "序号",
    key: "id",
    type: "index",
    width: 65,
    align: "center"
  },
  {
    title: "事件编号",
    key: "dreventno"
  },
  {
    title: "区域",
    key: "customername"
  },
  {
    title: "事件类型",
    key: "dreventLabel"
  },
  {
    title: "响应策略类型",
    key: "controlledLabel"
  },
  {
    title: "响应目标容量（kVA）",
    key: "drcap"
  },
  {
    title: "开始时间",
    key: "starttime"
  },
  {
    title: "结束时间",
    key: "endtime"
  },
  {
    title: "客户评估结果",
    key: "assessResultLabel"
  },
  {
    title: "客户是否响应及时",
    key: "custResponseLabel"
  },
  {
    title: "状态",
    key: "issueLabel"
  },
  {
    title: "校验结果",
    key: "reviewLabel"
  }
].map((element) => {
  const { width } = element;
  if (!width) {
    return {
      ...element,
      minWidth: 200
    };
  }
  return element;
});

export const EDIT_RULES = {
  controlledtype: [
    {
      type: "string",
      required: true,
      message: "请选择事件类型",
      trigger: "change"
    }
  ],
  dreventtype: [
    {
      type: "string",
      required: true,
      message: "请选择响应策略类型",
      trigger: "change"
    }
  ],
  starttime: [
    {
      type: "date",
      required: true,
      message: "选择开始时间",
      trigger: "change"
    }
  ],
  endtime: [
    {
      type: "date",
      required: true,
      message: "选择结束时间",
      trigger: "change"
    }
  ]
};

export const TABLE_DECOMPOSE_COLUNMS = [
  {
    title: "序号",
    key: "id",
    type: "index",
    width: 65,
    align: "center"
  },
  {
    title: "区域",
    key: "age"
  },
  {
    title: "厂站",
    key: "address"
  },
  {
    title: "用户名称",
    key: "address"
  },
  {
    title: "设备ID",
    key: "address"
  },
  {
    title: "设备名称",
    key: "address"
  },
  {
    title: "可调负荷",
    key: "address"
  },
  {
    title: "控制前",
    key: "address"
  },
  {
    title: "控制后",
    key: "address"
  }
].map((element) => {
  const { width } = element;
  if (!width) {
    return {
      ...element,
      minWidth: 200
    };
  }
  return element;
});
